package com.chixing.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.chixing.entity.Dish;
import com.chixing.entity.DishType;
import com.chixing.mapper.DishMapper;
import com.chixing.mapper.DishTypeMapper;
import com.chixing.service.IDishTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chixing.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author smith
 * @since 2025-05-21
 */
@Service
public class DishTypeServiceImpl  implements IDishTypeService {
    @Autowired
    private DishTypeMapper typeMapper;

    @Override
    public Result getAll() {
        List<DishType> typeList = typeMapper.selectList(null);
        if(typeList !=null && typeList.size() >0)
            return Result.getSuccess(typeList);
        return Result.getFail("暂无菜品类别数据");
    }
}

